package com.example.a33mvvm;

import android.app.Application;
import android.util.Log;

import com.example.base_mvvm.money.AppDataBaseUtils;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMOptions;
import com.tencent.live2.V2TXLivePremier;
import com.tencent.rtmp.TXLiveBase;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        //初始化数据库的RoomDataBase
        AppDataBaseUtils.getInstance().init(this);
        //初始化友盟
        UMConfigure.init(this, "65e454b9a7208a5af1b3f474", "umeng", UMConfigure.DEVICE_TYPE_PHONE, "");
        PlatformConfig.setQQZone("7240100238501610496","A5A9A43A9AE58340C5B4432BCB67E749");
        //初始化环信
        EMOptions options = new EMOptions();
        options.setAppKey("1122240109154050#mvvm-3-7");
        EMClient.getInstance().init(this, options);

        //直播
        String licenceURL = "https://license.vod2.myqcloud.com/license/v2/1324867742_1/v_cube.license"; // 获取到的 licence url
        String licenceKey = "47ca79a178a3f21fd55260d945b0aeab"; // 获取到的 licence key

        V2TXLivePremier.setLicence(this, licenceURL, licenceKey);
        V2TXLivePremier.setObserver(new V2TXLivePremier.V2TXLivePremierObserver() {
            @Override
            public void onLicenceLoaded(int result, String reason) {
                Log.i("aaa", "onLicenceLoaded: result:" + result + ", reason:" + reason);
            }
        });
    }


}
